Skip to content

ref(node)!: Remove @opentelemetry/instrumentation dependency - #22843

Merged
andreiborza merged 1 commit into
developfrom
ab/js-3203-remove-otel-instrumentation-from-node
Jul 31, 2026
Merged

ref(node)!: Remove @opentelemetry/instrumentation dependency#22843
andreiborza merged 1 commit into
developfrom
ab/js-3203-remove-otel-instrumentation-from-node

Conversation

@andreiborza

@andreiborza andreiborza commented Jul 29, 2026

Copy link
Copy Markdown
Member

What

Bottom of a stack. Removes the @opentelemetry/instrumentation dependency from @sentry/node, the last package that still declared it.

  • Delete the unused generateInstrumentOnce export (and the framework re-exports of it).
  • Remove ensureIsWrapped and the missing_instrumentation context it set, and the disableInstrumentationWarnings option and MissingInstrumentationContext type from @sentry/core.
  • Inline / prune the leftover InstrumentationConfig types in @sentry/node.
  • Make @sentry/node/import an orchestrion-only diagnostics-channel hook; remove the legacy iitm @sentry/node/loader entry.
  • Add the makeOrchestrionLoader rollup util (import-only, delegates to @sentry/server-utils/orchestrion/import-hook). The legacy makeOtelLoaders util is kept temporarily so the framework SDKs still build until they migrate in the PRs stacked on top of this one.

Why

All instrumentation is channel-based via orchestrion, so nothing uses @opentelemetry/instrumentation anymore. generateInstrumentOnce had no call sites, and ensureIsWrapped's shimmer-based detection can't see channel-based express/koa/hapi, so its warning only produced false negatives. The @sentry/node/import hook already registered the orchestrion injection; the iitm register() it also did instrumented nothing.

Breaking change, part of the v11 major. Keeping makeOtelLoaders in this PR keeps develop green as each framework migrates in its own follow-up PR.

@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

JS-3203

@andreiborza

andreiborza commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

batman begin

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5681acc. Configure here.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 47.08 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.09 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.82 kB - -
@sentry/browser (incl. Tracing, Replay) 86.39 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.11 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB - -
@sentry/browser (incl. Feedback) 47.14 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.77 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.61 kB - -
@sentry/react (incl. Tracing) 49.33 kB - -
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 49.05 kB - -
@sentry/svelte 29.86 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 47.45 kB - -
CDN Bundle (incl. Logs, Metrics) 33.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.83 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.08 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB - -
CDN Bundle - uncompressed 95.11 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.34 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.32 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.58 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.6 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.3 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.26 kB - -
@sentry/nextjs (client) 51.92 kB - -
@sentry/sveltekit (client) 47.51 kB - -
@sentry/core/server 79.63 kB - -
@sentry/core/browser 51.7 kB - -
@sentry/node 121.41 kB +0.01% +1 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B removed removed
@sentry/node - without tracing 84.91 kB +0.01% +1 B 🔺
@sentry/aws-serverless 93.19 kB +0.01% +4 B 🔺
@sentry/cloudflare (withSentry) - minified 198.35 kB - -
@sentry/cloudflare (withSentry) 487.75 kB - -

View base workflow run

Comment on lines +78 to +79
// All options below do not do anything anymore in this instrumentation, and will be removed in the future.
// They are only kept here for backwards compatibility - the respective functionality is now handled by the httpServerIntegration/httpServerSpansIntegration.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have tracking issues for these, I just removed the unnecessary InstrumentationConfig from here.

@andreiborza
andreiborza force-pushed the ab/js-3203-remove-otel-instrumentation-from-node branch from c89c176 to 94f3362 Compare July 30, 2026 12:36

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 94f3362. Configure here.

Comment thread MIGRATION.md Outdated
@andreiborza
andreiborza requested a review from JPeer264 July 31, 2026 12:55
`@sentry/node` was the last package holding `@opentelemetry/instrumentation`.
All instrumentation is now channel-based via orchestrion, so the surface this
dependency backed is dead or a no-op:

- `generateInstrumentOnce` (and the framework re-exports) had no call sites.
- `ensureIsWrapped`'s shimmer-based check can no longer detect channel-based
  express/koa/hapi, so its warning and the `missing_instrumentation` context
  were removed, along with the `disableInstrumentationWarnings` option and the
  `MissingInstrumentationContext` type.
- The `@sentry/node/import` ESM hook now only registers the orchestrion
  diagnostics-channel injection; the legacy iitm `@sentry/node/loader` entry
  was removed.

Adds the `makeOrchestrionLoader` rollup util (import-only, delegates to
`@sentry/server-utils/orchestrion/import-hook`). The legacy `makeOtelLoaders`
util is kept temporarily so the framework SDKs still build until they migrate
in the following PRs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@andreiborza
andreiborza force-pushed the ab/js-3203-remove-otel-instrumentation-from-node branch from 882fce1 to 3d28150 Compare July 31, 2026 12:55
Comment thread packages/node/package.json
@andreiborza
andreiborza requested a review from msonnb July 31, 2026 13:08
Comment thread yarn.lock
forwarded-parse "2.1.2"

"@opentelemetry/instrumentation@0.220.0", "@opentelemetry/instrumentation@^0.220.0":
"@opentelemetry/instrumentation@0.220.0":

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only remaining usage of this is from the integration tests. We will probably remove this with #21116

@andreiborza
andreiborza merged commit 4248eed into develop Jul 31, 2026
270 checks passed
@andreiborza
andreiborza deleted the ab/js-3203-remove-otel-instrumentation-from-node branch July 31, 2026 13:41
andreiborza added a commit that referenced this pull request Jul 31, 2026
## What

Part of the `@opentelemetry/instrumentation` removal stack (based on
#22843).

- Switch `@sentry/astro`'s `./import` loader from the legacy
`makeOtelLoaders` build util to `makeOrchestrionLoader`, so the
generated `import-hook.mjs` imports
`@sentry/server-utils/orchestrion/import-hook` directly.
- Drop the obsolete `./loader` export (the iitm `--loader` entry, unused
on Node >= 20.19).

## Why

Orchestrion is the only instrumentation path now, so the framework's
`--import` hook should register it directly instead of the removed iitm
loader. `--loader` no longer applies (minimum Node is 20.19.0) and
orchestrion has no `--loader` equivalent, so the `./loader` export is
dead.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza added a commit that referenced this pull request Jul 31, 2026
…22862)

## What

Part of the `@opentelemetry/instrumentation` removal stack (based on
#22843).

- Switch `@sentry/aws-serverless`'s `./import` loader from the legacy
`makeOtelLoaders` build util to `makeOrchestrionLoader`, so the
generated `import-hook.mjs` imports
`@sentry/server-utils/orchestrion/import-hook` directly.
- Drop the obsolete `./loader` export (the iitm `--loader` entry, unused
on Node >= 20.19).

## Why

Orchestrion is the only instrumentation path now, so the framework's
`--import` hook should register it directly instead of the removed iitm
loader. `--loader` no longer applies (minimum Node is 20.19.0) and
orchestrion has no `--loader` equivalent, so the `./loader` export is
dead.
andreiborza added a commit that referenced this pull request Jul 31, 2026
…Loader (#22863)

## What

Part of the `@opentelemetry/instrumentation` removal stack (based on
#22843).

- Switch `@sentry/google-cloud-serverless`'s `./import` loader from the
legacy `makeOtelLoaders` build util to `makeOrchestrionLoader`, so the
generated `import-hook.mjs` imports
`@sentry/server-utils/orchestrion/import-hook` directly.
- Drop the obsolete `./loader` export (the iitm `--loader` entry, unused
on Node >= 20.19).

## Why

Orchestrion is the only instrumentation path now, so the framework's
`--import` hook should register it directly instead of the removed iitm
loader. `--loader` no longer applies (minimum Node is 20.19.0) and
orchestrion has no `--loader` equivalent, so the `./loader` export is
dead.
andreiborza added a commit that referenced this pull request Jul 31, 2026
## What

Part of the `@opentelemetry/instrumentation` removal stack (based on
#22843).

- Switch `@sentry/nextjs`'s `./import` loader from the legacy
`makeOtelLoaders` build util to `makeOrchestrionLoader`, so the
generated `import-hook.mjs` imports
`@sentry/server-utils/orchestrion/import-hook` directly.
- Drop the obsolete `./loader` export (the iitm `--loader` entry, unused
on Node >= 20.19).

## Why

Orchestrion is the only instrumentation path now, so the framework's
`--import` hook should register it directly instead of the removed iitm
loader. `--loader` no longer applies (minimum Node is 20.19.0) and
orchestrion has no `--loader` equivalent, so the `./loader` export is
dead.
andreiborza added a commit that referenced this pull request Jul 31, 2026
## What

Part of the `@opentelemetry/instrumentation` removal stack (based on
#22843).

- Switch `@sentry/remix`'s `./import` loader from the legacy
`makeOtelLoaders` build util to `makeOrchestrionLoader`, so the
generated `import-hook.mjs` imports
`@sentry/server-utils/orchestrion/import-hook` directly.
- Drop the obsolete `./loader` export (the iitm `--loader` entry, unused
on Node >= 20.19).

## Why

Orchestrion is the only instrumentation path now, so the framework's
`--import` hook should register it directly instead of the removed iitm
loader. `--loader` no longer applies (minimum Node is 20.19.0) and
orchestrion has no `--loader` equivalent, so the `./loader` export is
dead.
andreiborza added a commit that referenced this pull request Jul 31, 2026
…er (#22866)

## What

Part of the `@opentelemetry/instrumentation` removal stack (based on
#22843).

- Switch `@sentry/tanstackstart-react`'s `./import` loader from the
legacy `makeOtelLoaders` build util to `makeOrchestrionLoader`, so the
generated `import-hook.mjs` imports
`@sentry/server-utils/orchestrion/import-hook` directly.
- Drop the obsolete `./loader` export (the iitm `--loader` entry, unused
on Node >= 20.19).

## Why

Orchestrion is the only instrumentation path now, so the framework's
`--import` hook should register it directly instead of the removed iitm
loader. `--loader` no longer applies (minimum Node is 20.19.0) and
orchestrion has no `--loader` equivalent, so the `./loader` export is
dead.
andreiborza added a commit that referenced this pull request Jul 31, 2026
## What

Top of the `@opentelemetry/instrumentation` removal stack.

- Remove the legacy `makeOtelLoaders` rollup util and its hook templates
(`otelEsm*`, `sentryNodeEsm*`).

## Why

The base PR (#22843) kept `makeOtelLoaders` as a temporary shim so the
framework SDKs kept building while each migrated to
`makeOrchestrionLoader` in its own stacked PR. With all of them
migrated, the iitm-era util and templates are unused and can go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants